package priv.wjh.study.cloud.feign.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import priv.wjh.study.cloud.feign.api.ao.BaseAo;
import priv.wjh.study.cloud.feign.api.config.FeignGenericSupportConfig;
import priv.wjh.study.cloud.feign.api.config.GenericArgument;
import priv.wjh.study.cloud.feign.api.config.GenericResult;

/**
 * //TODO
 *
 * @author wangjunhao
 **/
@FeignClient(name = "studyFeign", url = "http://localhost:10010", path = "/test", configuration = FeignGenericSupportConfig.class)
public interface StudyFeignApi {
    @GetMapping
    String test();

    @GetMapping(value = "test2", produces = "application/json;charset=utf-8")
    MyTestVo test2();

    @PostMapping("/generic")
    @GenericArgument
    <T extends BaseAo> void genericTest(T ao);

    @PostMapping("/generic/result")
    @GenericResult
    BaseAo getAo(@RequestBody Integer type);
}
